//
//  ZyaPurchaseDetailFooter.swift
//  SlaughterClient
//
//  Created by hudan on 2025/11/17.
//  Copyright © 2025 zwb. All rights reserved.
//

import UIKit

final class ZyaPurchaseDetailFooter: UIView {
    
    var addBlock: (() -> Void)?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        initUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func initUI() {
        extBgColor(color: .clear)
        
        let addBtn = UIButton().easy("添加产品", UIColor(kshex: "333333"), .boldSystemFont(ofSize: 17), "xinzeng", self, #selector(addBtnClick))
        addBtn.titleEdgeInsets = .init(top: 0, left: 10, bottom: 0, right: 0)
        addBtn.imageEdgeInsets = .init(top: 5, left: 5, bottom: 5, right: 75)
        addSubview(addBtn)
        addBtn.snp.makeConstraints { make in
            make.center.equalToSuperview()
            make.size.equalTo(CGSize(width: 100, height: 30))
        }
    }
    
    @objc func addBtnClick() {
        addBlock?()
    }
}
